package com.leenmvc.core.security.entity.core;

import com.leenmvc.core.web.Result;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * @Author: JohnCoding
 * @Description: 系统接口信息实体
 * @date: 2020/1/7 14:07
 */
public class SysApiController {

    /**
     * 接口url
     */
    private String url;

    /**
     * 接口对应的类名称
     */
    private String className;

    /**
     * 接口方法名
     */
    private String method;

    /**
     * 接口参数
     */
    private List<SysParamer> params;

    /**
     * 接口请求方式
     */
    private String type;

    /**
     * 接口说明
     */
    private String note;

    /**
     * 接口所在类说明
     */
    private String apiDescription;

    /**
     * 如果参数为实体则保存字段属性到这里
     */
    private Map<String,Object> fields;

    /**
     * 参数是否为实体
     */
    private boolean paramerIsEntity;

    /**
     * 参数为实体的时候的参数名称
     */
    private String paramerEntityName;

    /**
     * 接口所需授权
     */
    private String[] requiresPermissions;

    /**
     * 返回类型示例
     */
    private Result returnData;

    public Result getReturnData() {
        return returnData;
    }

    public void setReturnData(Result returnData) {
        this.returnData = returnData;
    }

    public boolean isParamerIsEntity() {
        return paramerIsEntity;
    }

    public String getParamerEntityName() {
        return paramerEntityName;
    }

    public void setParamerEntityName(String paramerEntityName) {
        this.paramerEntityName = paramerEntityName;
    }

    public void setParamerIsEntity(boolean paramerIsEntity) {
        this.paramerIsEntity = paramerIsEntity;
    }

    public Map<String, Object> getFields() {
        return fields;
    }

    public void setFields(Map<String, Object> fields) {
        this.fields = fields;
    }

    public String[] getRequiresPermissions() {
        return requiresPermissions;
    }

    public void setRequiresPermissions(String[] requiresPermissions) {
        this.requiresPermissions = requiresPermissions;
    }

    public String getApiDescription() {
        return apiDescription;
    }

    public void setApiDescription(String apiDescription) {
        this.apiDescription = apiDescription;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public List<SysParamer> getParams() {
        return params;
    }

    public void setParams(List<SysParamer> params) {
        this.params = params;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Override
    public String toString() {
        return "SysApiController{" +
                "url='" + url + '\'' +
                ", className='" + className + '\'' +
                ", method='" + method + '\'' +
                ", params=" + params +
                ", type='" + type + '\'' +
                ", note='" + note + '\'' +
                ", apiDescription='" + apiDescription + '\'' +
                ", columns=" + fields +
                ", paramerIsEntity=" + paramerIsEntity +
                ", paramerEntityName='" + paramerEntityName + '\'' +
                ", requiresPermissions=" + Arrays.toString(requiresPermissions) +
                ", returnData=" + returnData +
                '}';
    }
}
